package live_schedule

import (
	"vrcm/src/vrcm/common/models"
)

type ChannelTask struct {
	models.Model

	TenantId        string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId       int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	SourceId        int    `json:"source_id" gorm:"type:bigint unsigned;comment:信源id"`
	TrafficOnId     int    `json:"traffic_on_id" gorm:"type:bigint unsigned;comment:上车点id"`
	TrafficOffId    int    `json:"traffic_off_id" gorm:"type:bigint unsigned;comment:下车点id"`
	MediaId         int    `json:"media_id" gorm:"type:bigint;comment:媒体处理id"`
	TaskState       int    `json:"task_state" gorm:"type:tinyint;comment:状态1上线2异常 3离线"`
	TaskId          string `json:"task_id" gorm:"type:varchar(100);comment:任务id"`
	InNodeId        string `json:"in_node_id" gorm:"type:varchar(100);comment:输入节点id"`
	OutNodeId       string `json:"out_node_id" gorm:"type:varchar(100);comment:输出节点id"`
	LiveId          string `json:"live_id" gorm:"type:varchar(100);comment:全球直播任务id"`
	InUrl           string `json:"in_url" gorm:"type:varchar(300);comment:输入源地址"`
	OutUrl          string `json:"out_url" gorm:"type:varchar(300);comment:输出源地址"`
	PushUrl         string `json:"push_url" gorm:"type:varchar(300);comment:第三方推流地址"`
	ExtraInfo       string `json:"extra_info" gorm:"type:varchar(300);comment:额外信息"`
	StateUpdateTime int64  `json:"state_update_time" gorm:"column:state_update_time;type:int;comment:节点状态更新时间"`
	OutputStreamId  string `json:"output_stream_id" gorm:"type:varchar(100);comment:下车点输出id"`
	CustomOutUrl    string `json:"custom_out_url" gorm:"type:varchar(100);comment:自定义输出地址"`
	Area            int    `json:"area" gorm:"type:tinyint;comment:1 外网 2内网"`
	models.ModelTime
	models.ControlBy
}

func (ChannelTask) TableName() string {
	return "channel_task"
}

func (e *ChannelTask) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *ChannelTask) GetId() interface{} {
	return e.Id
}

type TrafficOn struct {
	models.Model

	TenantId        string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId       int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	SourceId        int    `json:"source_id" gorm:"type:bigint unsigned;comment:信源或信源组id"`
	GroupId         string `json:"group_id" gorm:"type:varchar(50) unsigned;comment:信源或信源组id"`
	GroupName       string `json:"group_name" gorm:"type:varchar(50);comment:组名称"`
	TrafficOnName   string `json:"traffic_on_name" gorm:"type:varchar(50);comment:上车点名称"`
	TrafficOnType   int    `json:"traffic_on_type" gorm:"type:tinyint;comment:1信源池 2信源组 3 rtmp 4 hls 5https  6srt 7udp 8sdi"`
	IsGroup         int    `json:"is_group" gorm:"type:tinyint;comment:是否是组 1是 2否"`
	StreamType      int    `json:"stream_type" gorm:"type:tinyint;comment:流类型 1原始流 2转码流"`
	NodeId          string `json:"node_id" gorm:"type:varchar(50);comment:节点唯一id"`
	SwitchId        string `json:"switch_id" gorm:"type:varchar(100);comment:切换任务id"`
	TransUdpUrl     string `json:"trans_udp_url" gorm:"type:varchar(300);comment:转码后的udp地址"`
	TransTaskId     string `json:"trans_task_id" gorm:"type:varchar(100);comment:转码任务id"`
	TransRecordId   int    `json:"trans_record_id" gorm:"type:bigint;comment:转码任务记录id"`
	TemplateId      string `json:"template_id" gorm:"type:varchar(50);comment:转码模版id"`
	IsDelete        int    `json:"is_delete" gorm:"type:tinyint;comment:是否删除 1是 2否"`
	EqUrl           string `json:"eq_url" gorm:"type:varchar(300);comment:设备地址"`
	Kind            int    `json:"kind" gorm:"type:tinyint;comment:1原始信源 2自定义信源 3设备"`
	TrafficOnState  int    `json:"traffic_on_state" gorm:"type:tinyint;comment:1启用2停用"`
	StateUpdateTime int64  `json:"state_update_time" gorm:"type:int;comment:节点状态更新时间"`
	models.ModelTime
	models.ControlBy
}

type TrafficOnModel struct {
	models.Model

	TenantId         string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId        int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	SourceId         int    `json:"source_id" gorm:"type:bigint unsigned;comment:信源或信源组id"`
	SourceName       string `json:"source_name" gorm:"type:varchar(50);comment:信源名称"`
	GroupId          string `json:"group_id" gorm:"type:varchar(50);comment:信源或信源组id"`
	GroupName        string `json:"group_name" gorm:"type:varchar(50);comment:信源组名称"`
	TrafficOnName    string `json:"traffic_on_name" gorm:"type:varchar(50);comment:上车点名称"`
	TrafficOnType    int    `json:"traffic_on_type" gorm:"type:tinyint;comment:1信源池 2信源组 3 rtmp 4 hls 5https  6srt 7udp 8sdi"`
	IsGroup          int    `json:"is_group" gorm:"type:tinyint;comment:是否是组 1是 2否"`
	StreamType       int    `json:"stream_type" gorm:"type:tinyint;comment:流类型 1原始流 2转码流"`
	NodeId           string `json:"node_id" gorm:"type:varchar(50);comment:节点唯一id"`
	ProtocolType     int    `json:"protocol_type" gorm:"type:tinyint;comment:协议类型1rtmp 2hls 3https 4srt 5udp 6sd"`
	TransUdpUrl      string `json:"trans_udp_url" gorm:"type:varchar(300);comment:转码后的udp地址"`
	TransTaskId      string `json:"trans_task_id" gorm:"type:varchar(100);comment:转码任务id"`
	SourceStreamType int    `json:"source_stream_type" gorm:"type:tinyint;comment:信源流类型"`
	SourceArea       int    `json:"source_area" gorm:"type:tinyint;comment:信源区域"`
	SourceType       int    `json:"source_type" gorm:"type:tinyint;comment:信源类型"`
	TransRecordId    int    `json:"trans_record_id" gorm:"type:bigint;comment:转码任务记录id"`
	Kind             int    `json:"kind" gorm:"type:tinyint;comment:1原始信源 2自定义信源"`
	SwitchId         string `json:"switch_id" gorm:"type:varchar(300);comment:切换任务id"`
	TrafficOnState   int    `json:"traffic_on_state" gorm:"type:tinyint;comment:切换任务id"`
	StateUpdateTime  int64  `json:"state_update_time" gorm:"type:int;comment:节点状态更新时间"`
	models.ModelTime
	models.ControlBy
}

func (TrafficOn) TableName() string {
	return "traffic_on"
}

func (e *TrafficOn) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *TrafficOn) GetId() interface{} {
	return e.Id
}

type MediaProcess struct {
	models.Model

	TenantId        string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId       int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	MediaName       string `json:"media_name" gorm:"type:varchar(50);comment:媒体处理名称"`
	EnableAi        int    `json:"enable_ai" gorm:"type:tinyint;comment:是否启用 1是 2否"`
	MediaType       int    `json:"media_type" gorm:"type:tinyint;comment:媒体处理类型 1汇聚协转 2软矩阵 3审核 4转码 5录制 6水印"`
	PlayType        int    `json:"play_type" gorm:"type:tinyint;comment:播放模式 1正常 2延迟"`
	Delay           int    `json:"delay" gorm:"type:int;comment:延迟秒数"`
	NodeId          string `json:"node_id" gorm:"type:varchar(50);comment:节点唯一id"`
	Frequency       int    `json:"frequency" gorm:"type:int;comment:频率"`
	TemplateId      string `json:"template_id" gorm:"type:varchar(50);comment:模版ID"`
	ExtraInfo       string `json:"extra_info" gorm:"type:varchar(1000);comment:额外信息"`
	EnableSwitch    int    `json:"enable_switch" gorm:"type:tinyint;comment:是否启用 1是 2否"`
	MediaState      int    `json:"media_state" gorm:"type:tinyint;comment:媒体处理的状态"`
	StateUpdateTime int64  `json:"state_update_time" gorm:"type:int;comment:节点状态更新时间"`
	models.ModelTime
	models.ControlBy
}

func (MediaProcess) TableName() string {
	return "media_process"
}

func (e *MediaProcess) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *MediaProcess) GetId() interface{} {
	return e.Id
}

type TrafficOff struct {
	models.Model

	TenantId         string          `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId        int             `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	TrafficOffName   string          `json:"traffic_off_name" gorm:"type:varchar(50);comment:下车点名称"`
	TrafficOffType   int             `json:"traffic_off_type" gorm:"type:tinyint;comment:1rtmp 2hls 3httpts 4srt 5udp 6flv 7sdi"`
	Area             int             `json:"area" gorm:"type:tinyint;comment:区域1.外网 2内网 3自动调度"`
	StreamType       int             `json:"stream_type" gorm:"type:tinyint;comment:流类型 1转推第三方 2拉流至第三方"`
	PushUrl          string          `json:"push_url" gorm:"type:varchar(300);comment:第三方推流地址"`
	NodeId           string          `json:"node_id" gorm:"type:varchar(50);comment:节点唯一id"`
	IsCustom         int             `json:"is_custom" gorm:"type:tinyint;comment: 是否自定义 1是 2否"`
	AreaType         string          `json:"area_type" gorm:"type:varchar(50);comment: 区域"`
	EnableBlackWhite int             `json:"enable_black_white" gorm:"type:tinyint;comment: 1启用 2不启用"`
	ListType         int             `json:"list_type" gorm:"type:tinyint;comment:名单类型 1黑名单 2白名单"`
	EquipCode        string          `json:"equip_code" gorm:"type:varchar(100);comment: 设备编号"`
	IPAddresses      []HlsBlackWhite `json:"ip_addresses" gorm:"-"`
	PushInfos        string          `json:"push_infos" gorm:"type:varchar(1000);comment: 转推地址"`
	PullInfos        string          `json:"pull_infos" gorm:"type:varchar(1000);comment: 拉流地址"`
	TrafficOffState  int             `json:"traffic_off_state" gorm:"type:tinyint;comment:1启用2停用"`
	StateUpdateTime  int64           `json:"state_update_time" gorm:"type:int;comment:节点状态更新时间"`
	models.ModelTime
	models.ControlBy
}

type TrafficOffModel struct {
	TrafficOff TrafficOff `json:"traffic_off"`
	NodeInfos  []NodeInfo `json:"node_infos"`
}

type NodeInfo struct {
	UpId           int    `json:"up_id" comment:"信源id"`
	SourceId       int    `json:"source_id" comment:"信源id"`
	NodeState      int    `json:"node_state" comment:"节点状态 1正常 2异常 3离线"`
	NodeUrl        string `json:"node_url" comment:"节点地址"`
	InNodeId       string `json:"in_node_id" comment:"节点id"`
	OutNodeId      string `json:"out_node_id" comment:"输出节点id"`
	OutputStreamId string `json:"output_stream_id" comment:"输出节点id"`
	OutputName     string `json:"output_name" comment:"下车点输出名"`
	CustomUrl      string `json:"custom_url" comment:"自定义url"`
	TransCodeName  string `json:"trans_code_name" comment:"转码任务名称"`
}

func (TrafficOff) TableName() string {
	return "traffic_off"
}

func (e *TrafficOff) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *TrafficOff) GetId() interface{} {
	return e.Id
}

type UpMedia struct {
	models.Model

	TenantId      string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId     int    `json:"channel_id" gorm:"type:bigint unsigned;comment:租户id"`
	UpId          int    `json:"up_id" gorm:"type:bigint unsigned;comment:上车点id"`
	MediaId       int    `json:"media_id" gorm:"type:bigint unsigned;comment:媒体id"`
	TrafficOnName string `json:"traffic_on_name" gorm:"type:varchar(50);comment:上车点名称"`
	SourceName    string `json:"source_name" gorm:"type:varchar(50);comment:信源名称"`
	SourceId      int    `json:"source_id" gorm:"type:bigint unsigned;comment:信源id"`
	TaskState     int    `json:"task_state" gorm:"type:int;comment:任务状态"`
	models.ModelTime
	models.ControlBy
}

func (UpMedia) TableName() string {
	return "up_media"
}

func (e *UpMedia) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *UpMedia) GetId() interface{} {
	return e.Id
}

type MediaOff struct {
	models.Model

	TenantId  string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId int    `json:"channel_id" gorm:"type:bigint unsigned;comment:租户id"`
	OffId     int    `json:"off_id" gorm:"type:bigint unsigned;comment:下车点id"`
	MediaId   int    `json:"media_id" gorm:"type:bigint unsigned;comment:媒体id"`
	models.ModelTime
	models.ControlBy
}

func (MediaOff) TableName() string {
	return "media_off"
}

func (e *MediaOff) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *MediaOff) GetId() interface{} {
	return e.Id
}

type ScheduleRecord struct {
	models.Model

	TenantId      string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId     int    `json:"channel_id" gorm:"type:bigint unsigned;comment:调度id或者信源id"`
	ChannelTaskId string `json:"channel_task_id" gorm:"type:varchar(50);comment:调度任务id或者其他任务id"`
	Type          int    `json:"type" gorm:"type:int;comment:1通道时长 2 转码时长 3录制时长 4审核时常 5水印 6直播时长"`
	StartTime     int64  `json:"start_time" gorm:"type:int;comment:开始时间"`
	EndTime       int64  `json:"end_time" gorm:"type:int;comment:结束时间"`
	models.ModelTime
	models.ControlBy
}

func (ScheduleRecord) TableName() string {
	return "schedule_record"
}

func (e *ScheduleRecord) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *ScheduleRecord) GetId() interface{} {
	return e.Id
}

type CortexOutput struct {
	models.Model

	TenantId       string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId      int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	MediaProcessId int    `json:"media_process_id" gorm:"type:bigint unsigned;comment:媒体处理id"`
	OutName        string `json:"out_name" gorm:"type:varchar(50);comment:输出名称"`
	SwitchTaskId   string `json:"switch_task_id" gorm:"type:varchar(100);comment:切换任务id"`
	OutUdpUrl      string `json:"out_udp_url" gorm:"type:varchar(300);comment:切换地址"`
	models.ModelTime
	models.ControlBy
}

func (CortexOutput) TableName() string {
	return "cortex_output"
}

type CortexTask struct {
	models.Model

	TenantId        string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId       int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	SourceId        int    `json:"source_id" gorm:"type:bigint unsigned;comment:信源id"`
	TrafficOnId     int    `json:"traffic_on_id" gorm:"type:bigint unsigned;comment:上车点id"`
	CortexOutputId  int    `json:"cortex_output_id" gorm:"type:bigint unsigned;comment:棋盘格输出id"`
	TrafficOffId    int    `json:"traffic_off_id" gorm:"type:bigint unsigned;comment:下车点id"`
	MediaProcessId  int    `json:"media_process_id" gorm:"type:bigint unsigned;comment:媒体处理id"`
	TaskState       int    `json:"task_state" gorm:"type:tinyint;comment:状态1上线2异常 3离线"`
	InNodeId        string `json:"in_node_id" gorm:"type:varchar(100);comment:输入节点id"`
	OutNodeId       string `json:"out_node_id" gorm:"type:varchar(100);comment:输出节点id"`
	TaskId          string `json:"task_id" gorm:"type:varchar(100);comment:任务id"`
	LiveId          string `json:"live_id" gorm:"type:varchar(100);comment:全球直播任务id"`
	InUrl           string `json:"in_url" gorm:"type:varchar(300);comment:输入源地址"`
	OutUrl          string `json:"out_url" gorm:"type:varchar(300);comment:输出源地址"`
	StateUpdateTime int64  `json:"state_update_time" gorm:"type:int;comment:节点状态更新时间"`
	PushUrl         string `json:"push_url" gorm:"type:varchar(300);comment:第三方推流地址"`
	ExtraInfo       string `json:"extraInfo" gorm:"type:varchar(300);comment:额外信息"`
	OutputStreamId  string `json:"output_stream_id" gorm:"type:varchar(100);comment:下车点统计id"`
	IsEnable        int    `json:"is_enable" gorm:"type:tinyint;comment:是否启用1是2否"`
	CustomOutUrl    string `json:"custom_out_url" gorm:"type:varchar(100);comment:自定义输出地址"`
	Area            int    `json:"area" gorm:"type:tinyint;comment:1 外网 2内网"`
	SwitchNodeId    string `json:"switch_node_id" gorm:"type:varchar(300);comment:切换节点id"`
	models.ModelTime
	models.ControlBy
}

func (CortexTask) TableName() string {
	return "cortex_task"
}

type CortexTaskModel struct {
	UpId           int          `json:"up_id" comment:"上车点id"`
	CortexOutputId int          `json:"cortex_output_id" comment:"矩阵输出id"`
	CortexTasks    []CortexTask `json:"cortex_tasks" comment:"矩阵任务"`
	CortexState    int          `json:"cortex_state" comment:"状态1上线2异常 3离线 4切换中"`
	CortexInfos    []CortexInfo `json:"cortex_infos" comment:"转推或者自定义地址"`
}

type CortexInfo struct {
	OffId       int    `json:"off_id" comment:"上车id"`
	PushUrl     string `json:"push_url" comment:"推流地址"`
	PullUrl     string `json:"pull_url" comment:"拉流地址"`
	OutUrl      string `json:"out_url" comment:"原始拉流地址"`
	CortexOutId int    `json:"cortex_out_id" comment:"输出id"`
}

type AuditTask struct {
	models.Model

	TenantId      string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId     int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	SourceId      int    `json:"source_id" gorm:"type:bigint unsigned;comment:信源id"`
	TrafficOnId   int    `json:"traffic_on_id" gorm:"type:bigint unsigned;comment:上车点id"`
	TrafficOffId  int    `json:"traffic_off_id" gorm:"type:bigint unsigned;comment:下车点id"`
	MediaId       int    `json:"media_id" gorm:"type:bigint unsigned;comment:媒体处理id"`
	TaskState     int    `json:"task_state" gorm:"type:tinyint;comment:状态1上线2异常 3离线"`
	PullTaskState int    `json:"pull_task_state" gorm:"type:tinyint;comment:状态1上线2异常 3离线"`
	TaskId        string `json:"task_id" gorm:"type:varchar(100);comment:任务id"`
	PullTaskId    string `json:"pull_task_id" gorm:"type:varchar(100);comment:审核拉流任务id"`
	AuditPullUrl  string `json:"audit_pull_url" gorm:"type:varchar(100);comment:审核拉流url"`
	AuditTaskId   string `json:"audit_task_id" gorm:"type:varchar(100);comment:审核任务id"`
	//AuditUrl            string `json:"audit_url" gorm:"type:varchar(300);comment:审核url"`
	InNodeId            string `json:"in_node_id" gorm:"type:varchar(100);comment:输入节点id"`
	OutNodeId           string `json:"out_node_id" gorm:"type:varchar(100);comment:输出节点id"`
	LiveId              string `json:"live_id" gorm:"type:varchar(100);comment:全球直播任务id"`
	InUrl               string `json:"in_url" gorm:"type:varchar(300);comment:输入源地址"`
	OutUrl              string `json:"out_url" gorm:"type:varchar(300);comment:输出源地址"`
	PushUrl             string `json:"push_url" gorm:"type:varchar(300);comment:第三方推流地址"`
	ExtraInfo           string `json:"extra_info" gorm:"type:varchar(300);comment:额外信息"`
	StateUpdateTime     int64  `json:"state_update_time" gorm:"column:state_update_time;type:int;comment:节点状态更新时间"`
	PullStateUpdateTime int64  `json:"pull_state_update_time" gorm:"column:pull_state_update_time;type:int;comment:节点状态更新时间"`
	OutputStreamId      string `json:"output_stream_id" gorm:"type:varchar(100);comment:下车点输出id"`
	CustomOutUrl        string `json:"custom_out_url" gorm:"type:varchar(100);comment:自定义输出地址"`
	Area                int    `json:"area" gorm:"type:tinyint;comment:1 外网 2内网"`
	IsAudit             int    `json:"is_audit" gorm:"type:tinyint;comment:1 审核通过 2未通过"`
	AuditEndTime        int64  `json:"audit_end_time" gorm:"type:int;comment:审核结束时间"`
	IsEnable            int    `json:"is_enable" gorm:"type:tinyint;comment:1 创建审核 2 结束审核"`
	models.ModelTime
	models.ControlBy
}

type AuditResult struct {
	models.Model

	TenantId       string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId      int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	SourceId       int    `json:"source_id" gorm:"type:bigint unsigned;comment:信源id"`
	AssetId        string `json:"asset_id" gorm:"type:varchar(100);comment:素材id"`
	TaskId         string `json:"task_id" gorm:"type:varchar(100);comment:任务id"`
	AuditTaskId    string `json:"audit_task_id" gorm:"type:varchar(100);comment:任务id"`
	ViolationType  int    `json:"violation_type" gorm:"type:tinyint;comment:违规类型 1色情识别、2暴力、3恶心、4广告、5政治敏感 6其他"`
	ImgUrl         string `json:"img_url" gorm:"type:varchar(300);comment:违规图片"`
	FrameTimeStamp int    `json:"frame_time_stamp" gorm:"type:int;comment:帧图时间戳，单位s"`
	LogId          string `json:"log_id" gorm:"type:varchar(100);comment:任务id"`
	SubType        int    `json:"sub_type" gorm:"type:tinyint;comment:子类型"`
	AuditType      int    `json:"audit_type" gorm:"type:tinyint;comment:1直播 2长视频"`
	models.ModelTime
	models.ControlBy
}

func (AuditResult) TableName() string {
	return "audit_result"
}

type HlsBlackWhite struct {
	models.Model

	TenantId  string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	OffId     int    `json:"off_id" gorm:"type:bigint unsigned;comment:下车点id"`
	NodeId    string `json:"node_id" gorm:"type:varchar(100);comment:节点id"`
	IpAddress string `json:"ip_address" gorm:"type:varchar(100);comment:ip地址"`
	models.ModelTime
	models.ControlBy
}

func (HlsBlackWhite) TableName() string {
	return "hls_black_white"
}

type ScheduleTaskHistory struct {
	models.Model

	TenantId  string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	OffId     int    `json:"off_id" gorm:"type:bigint unsigned;comment:下车点id"`
	PullUrl   string `json:"pull_url" gorm:"type:varchar(300);comment:拉流地址"`
	models.ModelTime
	models.ControlBy
}

func (ScheduleTaskHistory) TableName() string {
	return "schedule_task_history"
}

type SwitchTask struct {
	models.Model

	TenantId        string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId       int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	ActiveItem      int    `json:"active_item" gorm:"type:int;comment:激活项"`
	MediaId         string `json:"media_id" gorm:"type:varchar(300);comment:媒体处理id"`
	TaskState       int    `json:"task_state" gorm:"type:tinyint;comment:状态1上线2异常 3离线"`
	TaskId          string `json:"task_id" gorm:"type:varchar(100);comment:任务id"`
	OutUrl          string `json:"out_url" gorm:"type:varchar(300);comment:输出源地址"`
	Area            int    `json:"area" gorm:"type:tinyint;comment:1 外网 2内网"`
	StateUpdateTime int64  `json:"state_update_time" gorm:"column:state_update_time;type:int;comment:节点状态更新时间"`
	models.ModelTime
	models.ControlBy
}

func (SwitchTask) TableName() string {
	return "switch_task"
}

type CovertTask struct {
	models.Model

	TenantId        string `json:"tenant_id" gorm:"type:varchar(50);comment:租户"`
	ChannelId       int    `json:"channel_id" gorm:"type:bigint unsigned;comment:通道id"`
	SourceId        int    `json:"source_id" gorm:"type:bigint unsigned;comment:信源id"`
	TrafficOnId     int    `json:"traffic_on_id" gorm:"type:bigint unsigned;comment:上车点id"`
	TrafficOffId    int    `json:"traffic_off_id" gorm:"type:bigint unsigned;comment:下车点id"`
	MediaId         string `json:"media_id" gorm:"type:varchar(300);comment:媒体处理id"`
	TaskState       int    `json:"task_state" gorm:"type:tinyint;comment:状态1上线2异常 3离线"`
	TaskId          string `json:"task_id" gorm:"type:varchar(100);comment:任务id"`
	InNodeId        string `json:"in_node_id" gorm:"type:varchar(100);comment:输入节点id"`
	OutNodeId       string `json:"out_node_id" gorm:"type:varchar(100);comment:输出节点id"`
	LiveId          string `json:"live_id" gorm:"type:varchar(100);comment:全球直播任务id"`
	InUrl           string `json:"in_url" gorm:"type:varchar(300);comment:输入源地址"`
	OutUrl          string `json:"out_url" gorm:"type:varchar(300);comment:输出源地址"`
	PushUrl         string `json:"push_url" gorm:"type:varchar(300);comment:第三方推流地址"`
	ExtraInfo       string `json:"extra_info" gorm:"type:varchar(300);comment:额外信息"`
	StateUpdateTime int64  `json:"state_update_time" gorm:"column:state_update_time;type:int;comment:节点状态更新时间"`
	OutputStreamId  string `json:"output_stream_id" gorm:"type:varchar(100);comment:下车点输出id"`
	CustomOutUrl    string `json:"custom_out_url" gorm:"type:varchar(100);comment:自定义输出地址"`
	Area            int    `json:"area" gorm:"type:tinyint;comment:1 外网 2内网"`
	models.ModelTime
	models.ControlBy
}

func (CovertTask) TableName() string {
	return "convert_task"
}
